xend: Set close-on-exec flag for datagram sockets
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 1 Apr 2009 10:45:22 +0000 (11:45 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 1 Apr 2009 10:45:22 +0000 (11:45 +0100)
We need to close the socket on the child side when xend creates a
child process such as qemu-dm.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
tools/python/xen/web/connection.py

index e507323e9155ebbe4b279470d4dd72867ad1e420..3d335d2fbdb9638155f4d738496779726dd64cd2 100644 (file)
@@ -317,6 +317,8 @@ class SocketDgramListener:
 
     def main(self):
         try:
+            fcntl.fcntl(self.sock.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)
+
             while True:
                 try:
                     data = self.sock.recv(BUFFER_SIZE)